package com.mairuide.bill.billcash;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.DecimalFormat;

public class BillCashDomain implements Serializable{
	private static final long serialVersionUID = 4236778482635814427L;
	private String accountBody;//交易主体
	private String accountBodyNumber;//交易主体账号
	private String accountBodyCard;//交易主体卡号
	private String accountRival;//交易对手
	private String accountRivalCard;//交易对手卡号
	private BigDecimal totalMoney;//现金总金额
	private Integer totalCount;//总次数
	
	private BigDecimal inMoney;//存现总金额
	private Integer inCount;//存现总次数
	private String inMoneyPercent;//存现金额比
	private String inCountPercent;//存现次数比
	
	private BigDecimal outMoney;////取现总金额
	private Integer outCount;//取现总次数
	private String outMoneyPercent;//取现金额比
	private String outCountPercent;//取现次数比
	
	public String getAccountBody() {
		return accountBody;
	}
	public void setAccountBody(String accountBody) {
		this.accountBody = accountBody;
	}
	public String getAccountBodyNumber() {
		return accountBodyNumber;
	}
	public void setAccountBodyNumber(String accountBodyNumber) {
		this.accountBodyNumber = accountBodyNumber;
	}
	public String getAccountBodyCard() {
		return accountBodyCard;
	}
	public void setAccountBodyCard(String accountBodyCard) {
		this.accountBodyCard = accountBodyCard;
	}
	public BigDecimal getTotalMoney() {
		return totalMoney;
	}
	public void setTotalMoney(BigDecimal totalMoney) {
		this.totalMoney = totalMoney;
	}
	public Integer getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}
	public BigDecimal getInMoney() {
		return inMoney;
	}
	public void setInMoney(BigDecimal inMoney) {
		this.inMoney = inMoney;
	}
	public Integer getInCount() {
		return inCount;
	}
	public void setInCount(Integer inCount) {
		this.inCount = inCount;
	}
	public String getInMoneyPercent() {
		return getPercent(inMoney, totalMoney);
	}
	public void setInMoneyPercent(String inMoneyPercent) {
		this.inMoneyPercent = inMoneyPercent;
	}
	public String getInCountPercent() {
		return getPercent(inCount, totalCount);
	}
	public void setInCountPercent(String inCountPercent) {
		this.inCountPercent = inCountPercent;
	}
	public BigDecimal getOutMoney() {
		return outMoney;
	}
	public void setOutMoney(BigDecimal outMoney) {
		this.outMoney = outMoney;
	}
	public Integer getOutCount() {
		return outCount;
	}
	public void setOutCount(Integer outCount) {
		this.outCount = outCount;
	}
	public String getOutMoneyPercent() {
		return getPercent(outMoney, totalMoney);
	}
	public void setOutMoneyPercent(String outMoneyPercent) {
		this.outMoneyPercent = outMoneyPercent;
	}
	public String getOutCountPercent() {
		return getPercent(outCount, totalCount);
	}
	public void setOutCountPercent(String outCountPercent) {
		this.outCountPercent = outCountPercent;
	}
	
    public String getAccountRival() {
		return accountRival;
	}
	public void setAccountRival(String accountRival) {
		this.accountRival = accountRival;
	}
	public String getAccountRivalCard() {
		return accountRivalCard;
	}
	public void setAccountRivalCard(String accountRivalCard) {
		this.accountRivalCard = accountRivalCard;
	}
	private String getPercent(Integer cc,Integer tt) {
    	if(cc==null || tt==null || cc==0 || tt==0) {
    		return "0%";
    	}else {
    		DecimalFormat df=new DecimalFormat("0.00");
    		String result = df.format((cc*100f)/tt);
    		return result+"%";
    	}
    }
    
    private String getPercent(BigDecimal cc,BigDecimal tt) {
    	if(cc==null || tt==null) {
    		return "0%";
    	}else {
    		DecimalFormat df=new DecimalFormat("0.00");
    		Double c = cc.doubleValue();
    		Double t = tt.doubleValue();
    		String result = df.format((c*100)/t);
    		return result+"%";
    	}
    }
}
